Skip to main content

All Questions

1vote
1answer
185views

insert a blank line before and after a match on mac OS

my file contains the Strings: ∗Cast and characters * Bob Denver is Gilligan I want to insert the line * ATTENTION * to any line starting with * followed by one OR more spaces. it will be preceded by ...
bull's user avatar
0votes
1answer
249views

Remove Strings from two patterns/characters with sed

I want to remove the string inside two patterns/characters, so if I have a file containing "% Blah blah % i want to remove Blah blah as well as the pattern character in this case it will be % %. ...
bull's user avatar
1vote
2answers
2kviews

Replace a phone number using sed

my txt file contains the phone number (233)- 332-9888 and I want to replace that with ###-###-####. I'm doing s|[0-9]{3}-[0-9]{3}-[0-9]{4}|###-###-####|g (In extended mode), my issue is I don't know ...
bull's user avatar
0votes
2answers
93views

Converting spaces in a text file to periods/full stops

I'm quite new to Linux so forgive my ignorance. I have a regular text file with plain text. I would like to know if it's possible to convert all the spaces within the file to periods/full stops. ...
aomine_daiki's user avatar
1vote
1answer
80views

Form a output by combining multiple lines

I have a log file as below: /export/home/got/logs/o2877612.01:job_1432787863184_159408 Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: /user/got/...
user126356's user avatar

close